import { View, Text } from "@tarojs/components";
import { Arrow } from "@taroify/icons";

import StyleModule from "./index.module.scss";

interface GoodsTitleProps {
  title?: string;
  isMore?: boolean;
  handleMore?: any;
}

export default function Index(props: GoodsTitleProps) {
  const { title = "title", isMore = true, handleMore } = props;

  return (
    <View className={StyleModule.title}>
      <View className={StyleModule.text}>{title}</View>

      <View className={StyleModule.more}>
        {isMore && (
          <View
            style={{
              display: "flex",
              alignItems: "center",
              gap: "3px",
            }}
            onClick={() => handleMore()}
          >
            <Text>More</Text>
            <Arrow />
          </View>
        )}
      </View>
    </View>
  );
}
